import java.io.*;

public class TestFileConstructors {
	public static void main (String [] args) {
		try {
			File f1 = new File("../java/sjcp");
			File f2 = new File("java/sjcp", "temp/myProg.java");
			File f3 = new File(f1, "./temp/myProg.java");
			
			System.out.println("Canonical Path for f1: " + f1.getCanonicalPath());
			System.out.println("Absolute  Path for f1: " + f1.getAbsolutePath());
			System.out.println("Get       Name for f1: " + f1.getName());
			if (f1.isAbsolute()) {
				System.out.println("f1 is absolute. ");
			}
			File f4 = f1.getAbsoluteFile();
			if (f4.isAbsolute()) {
				System.out.println("f4 is absolute. ");
			}

			System.out.println("Path for f2: " + f2.getCanonicalPath());
			System.out.println("Path for f3: " + f3.getCanonicalPath());
		}
		catch (IOException ioe){
			ioe.printStackTrace();
		}
	}
}
